<?php

namespace App\Http\Models\User;

use Illuminate\Foundation\Http\FormRequest;

/**
 * Class RegisterRequest
 * @package App\Http\Requests\Frontend\Access
 */
class LoginFrom extends FormRequest {

    /**
     * 确定用户是否被授权提出要求.
     * @return bool
     */
    public function authorize() {
        return true;
    }

    /**
     * 得到的验证规则的要求
     * @return array
     */
    public function rules() {
        return [
            'username' => 'required|max:16',
            'password' => 'required|min:6',
        ];
    }

    public function messages() {
        return [
            'username.required' => "账号不能为空",
            'username.max' => "最大不能超过十六位",
            'password.required' => "密码不能为空",
            'password.min' => "密码不能少于六位",
        ];
    }

}
